home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / comm / bbs / TA1_22.lha / Programming / Programming.guidelines next >
Text File  |  1996-10-06  |  3KB  |  97 lines

  1.              PROGRAMMING GUIDE LINES FOR TransAmiga BBS DOORS
  2.              ================================================
  3.  
  4. Introduction:
  5. -------------
  6.  
  7. I found that several doors for TransAmiga are not very well coded. Not at all
  8. safe for future versions of the BBS. I am happy that there are several people
  9. who write scripts and fine programs around TransAmiga, but v1.12 of TransAmiga
  10. BBS really makes it necessary to tell programmers what they have to care for.
  11.  
  12. General:
  13. --------
  14.  
  15. *
  16. If you use ARexx commands from the BBS and need a special case (upper or lower)
  17. then convert it yourself! The BBS may return case sensitive strings where
  18. actually upper case is returned.
  19.  
  20. *
  21. Don't use TransAmiga's config files if not really necessary. Use SystemInfo
  22. and UserInfo commands to get all needed information.
  23.  
  24. *
  25. If your program needs the sysop to watch then turn the LOCALDISPLAY ON. You
  26. have to set the local display to the mode it was before your program started!
  27. Use SYSTEMINFO N to get the status at the beginning.
  28.  
  29. *
  30. You can use GETCHARSTACK to get TransAmiga's command stack. If you use this
  31. command TransAmiga's stack is deleted. Examine the string you get. Delete
  32. the part that is for your application and send the rest TransAmiga. Use
  33. SETCHARSTACK at the end of your program to send the left string to
  34. TransAmiga.
  35.  
  36. *
  37. If you use CHR(12) [FF] or clear the screen in an other way you have to
  38. check if the user has clearcodes activated. Use USERINFO Y to get the
  39. setting. If you TA tells you that they are OFF you *should* NOT clear the
  40. screen. If it is really necessary to clear the screen then ignore the
  41. setting. e.g. when a full-screen-ed is finished
  42.  
  43. *
  44. Don't use a fixed language where possible. As USERINFO H returns the language
  45. it is possible to use different strings in your program. Don't expect English
  46. to be the default language! An example for ARexx scripts:
  47.  
  48. /* test script */
  49.  
  50. options results
  51. userinfo h
  52. language=RESULT
  53. IF language='DEFAULT' THEN
  54.   PRINT 'This is a language test'
  55. ELSE IF language='GERMAN' THEN
  56.   PRINT 'Dies ist ein Sprachentest'
  57. ELSE PRINT 'What a strange language did you choose?'
  58. EXIT 0
  59.  
  60. BTW: This script is not tested, it's just to show you how it works.
  61.  
  62. *
  63. If you use SENDNODEMSG ARexx command your text has NOT to exceed two lines.
  64. The CR to seperate the two lines has to be inserted by yourself but there
  65. has to be NO CR in front or at the end of the text.
  66.  
  67. ARexx macros:
  68. -------------
  69.  
  70. *
  71. Check for ###PANIC whenever you used a command that waits for input from the
  72. user.
  73.  
  74.  
  75. Direct Library Access from high-level languages (C, Modula-2, Oberon,...):
  76. --------------------------------------------------------------------------
  77.  
  78. *
  79. Get the status of the local display via SYSTEMINFO N. When it returns OFF
  80. disable your writing to the screen (Don't call ANSIWrite()). Really test the
  81. string OFF and NOT ON. You can test if ON is returned but you have to use
  82. ANSIWrite() if nothing is returned. When nothing is returned the version of
  83. TransAmiga actually running is lower 1.12.
  84.  
  85. *
  86. If you use the library to get user input you have to filter CHR(10) (LF)
  87. yourself. LFs should be ignored.
  88.  
  89. *
  90. If you use the library function PostNodeMsg you have to position the text
  91. yourself! Start at screenlength-1 but don't forget to save the cursor
  92. position before and restore it afterwards. Check TransAmiga.doc for ANSI
  93. codes of these functions.
  94.  
  95. Make fine programs! :-)
  96. - Sami Radwan -
  97.